import request from '@/utils/request'

// 创建月报
export function createReportMonth(data) {
  return request({
    url: '/water/report-month/create',
    method: 'post',
    data: data
  })
}

// 更新月报
export function updateReportMonth(data) {
  return request({
    url: '/water/report-month/update',
    method: 'put',
    data: data
  })
}

// 删除月报
export function deleteReportMonth(id) {
  return request({
    url: '/water/report-month/delete?id=' + id,
    method: 'delete'
  })
}

// 获得月报
export function getReportMonth(id) {
  return request({
    url: '/water/report-month/get?id=' + id,
    method: 'get'
  })
}

// 获得月报分页
export function getReportMonthPage(query) {
  return request({
    url: '/water/report-month/page',
    method: 'get',
    params: query
  })
}

// 导出月报 Excel
export function exportReportMonthExcel(query) {
  return request({
    url: '/water/report-month/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}

// 获得月报
export function getReportOneMonthList(date) {
  return request({
    url: '/water/report-month/get-one-month-report?date=' + date,
    method: 'get'
  })
}

// 获得N天数据
export function getNDay(data) {
  return request({
    url: '/water/report-month/get-n-day',
    method: 'post',
    data: data
  })
}

// 获得5天数据
export function get5EDay() {
  return request({
    url: '/water/report-month/get-5eday',
    method: 'get'
  })
}
